<?php
/**
 * Method Not Allowed Exception
 * Throw this exception when the user requests a method which they are not
 * allowed to access.
 *
 * Official HTTP Definition:
 * The method specified in the Request-Line is not allowed for the resource
 * identified by the Request-URI. The response MUST include an Allow header
 * containing a list of valid methods for the requested resource. 
 *
 * @package     Visi
 * @subpackage  Exceptions
 * @author      Luke Visinoni <luke.visinoni@gmail.com>
 * @copyright   (c) 2010 Luke Visinoni <luke.visinoni@gmail.com>
 * @version     $Id$
 * @todo        Implement this in the application code (make use of valid methods)
 */
class Visi_Controller_Response_Exception_MethodNotAllowed extends Visi_Controller_Response_Exception {

    public $code = 405;
    
    public $message = 'Method Not Allowed';
    
    protected $_validMethods;
    
    public function __construct($message = null, $code = null, Array $validMethods = array()) {
    
        if (is_null($message)) $message = $this->message;
        if (is_null($code)) $code = $this->code;
        return parent::__construct($message, $code);
    
    }

}